#include <iostream>

using namespace std;

int main()
{
    int t;
    while ( cin >> t )
    {
        int i,j;
        char data[71];
        cin.getline( data, 5 );
        for ( i = 0; i < t; i++ )
        {
            cin.getline( data, sizeof( data ) );
            for ( j = strlen( data ) - 1; j >= 0; j--)
                cout << data[ j ];
            cout << endl;
        }
    }
    return 0;
}
